<include file="__THEME__/public_header" />
<div class="content">
	<div class="wrap">
    	<div class="con_side">
        	<ul class="nav">
            	<li><a href="{:U('admin/Report/show_report_screen')}">市区级报告</a></li>
                <li><a href="{:U('admin/Report/show_garden_reports')}">园级报告</a></li>
                <li class="cursor"><a href="{:U('admin/Report/show_report_evaluate')}">评价报告</a></li>
                <li><a href="{:U('admin/Report/health_advice')}">体质改善方法</a></li>
            </ul>
        </div>
        <div class="con_main">
        	<div class="con_tit">
                <em>市区级体质评价报告筛选</em>
               <!--  <div class="search_wrap">
                	<form>
                    	<input class="search_inp" type="text" value="" id="uname" placeholder="按市/区名搜索">
                    <input class="search_btn" type="button" value="" onclick="select_filter();">
                    </form>
                </div> -->
            </div>
            <div class="con_box">
            	<ul class="slect_list2">
                    <li>
                        <div class="txt">省名：</div>
                        <div class="inp">
                            <select name="province" id="province" onchange="selectArea(1)">
                                <option value="0">---请选择---</option>
                                <volist name="province" id="province">
                                    <option value="{$province.area_id}">{$province.title}</option>
                                </volist>
                            </select>
                        </div>
                    </li>
                    <li>
                        <div class="txt">市名：</div>
                        <div class="inp">
                            <select name="city" id="city" onchange="selectArea(2)">
                                <option value="0">---请选择---</option>
                            </select>
                        </div>
                    </li>
                    <li>
                        <div class="txt">区名：</div>
                        <div class="inp">
                            <select name="area" id="area">
                                <option value="0">---请选择---</option>
                            </select>
                        </div>
                    </li>
                    <li>
                        <div class="txt">时间：</div>
                        <div class="inp">
                            <input  type="text" id="year" style="height:30px;" />
                        </div>
                    </li>
                    <li>
                        <div class="txt">季度：</div>
                        <div class="inp">
                            <select id="test_type">
                                <option value="1">春季</option>
                                <option value="2">秋季</option>
                            </select>
                        </div>
                    </li>
                </ul>
                <div class="action_link tc small">
                    <a class="save" href="javascript:select_filter();">确定</a>
                </div>
            </div>
            <div class="con_tit3">根据《国家体制测定标准手册（幼儿部分）》的相关测试标准，针对本次测试数据统计，其评级分布概括如下：</div>
            <div class="con_box">
            <label style="font-size: 16px;">
                <if condition="$data['rpt_name']">
                    <a href="{:U('public/Report/NormalReport',array('rpt_id'=>$data['rpt_id']))}" target="_black">
                        {$data.rpt_name}
                    </a>
                    <else/>
                    没有查询到相应报告
                </if>
            </label>
            	<div class="table_pic">
                </div>
                <div class="evaluation">
                    <input type="hidden" id="rpt_id" <if condition="$data['rpt_id']"> value="{$data.rpt_id}"<else/>value="0"</if>>
            		<p><a href="javascript:;" onclick="doEvaluation();">评价</a></p>
                	<p><textarea placeholder="我要说点什么……" id="comment">{$data.comment}</textarea></p>
                </div>
            </div>
            <!-- <div class="con_tit3">北京市具体区域肥胖儿国标分值比例分布状况如下：</div>
            <div class="con_box">
            	<h3 class="table_tit">朝阳区</h3>
                <div class="table_pic">
           	    	<img src="images/t2.jpg" alt="">
                </div>
                <h3 class="table_tit">西南区</h3>
                <div class="table_pic">
           	    	<img src="images/t2.jpg" alt="">
                </div>
            </div> -->
        </div>
    </div>
</div>
<script>
  function select_filter(){
      var city=$("#city").val();
      var uname=$("#uname").val();
      var area=$("#area").val();
      var year=$("#year").val();
      var test_type=$("#test_type").val();
      window.location.href = "{:U('admin/Report/show_report_evaluate')}"+"&city="+city+"&area="+area+"&year="+year+"&test_type="+test_type; 
  }
    function selectArea(type){
        if(type==1){
            var pid=$("#province").val();
            var name="city";
        }else{
            var pid=$("#city").val();
            var name="area";
        }
        if(pid>0){
            $.ajax({
              type: "GET",
              url:"{:U('public/TestData/getArea')}",
              data:"pid="+pid,
              dataType:"json",
              success:function(data){
                $("#"+name).html("");
                $("#"+name).append("<option value='0'>---请选择---</option>");
                $.each(data,function(i,item){
                  $("#"+name).append("<option value='"+item.area_id+"'>"+item.title+"</option>");
                }); 
              }
            });
        }
    }
    function doEvaluation(){
        var rpt_id=$("#rpt_id").val();
        var comment=$("#comment").val();
        if(rpt_id==0){
            alert("请选择市区级报告！");
            return ;
        }
        if(comment==""){
            alert("请评价后再提交");
            return ;
        }
        $.ajax({
            type: "POST",
            url:"{:U('public/Report/doSaveEvaluation')}",
            data:"rpt_id="+rpt_id+"&comment="+comment,
            dataType:"text",
            success:function(data){
              if(isNaN(data)){
                  alert(data);
              }else{
                window.location.href=window.location.href;
              }
            }
        });
    }
</script>
<include file="__THEME__/public_footer" />